﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MyNote.Data.Models.Note>>" %>
<%@ Import Namespace="MyNote.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	网络笔记
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <ul>
    <% foreach (var item in Model) { %>
    <li>
        <% if (item is MyNote.Data.Models.ReferenceNote)
           { %>         
        <%= Html.ActionLink(item.Title, "Details", "ReferenceNote", new { id = item.Id }, null)%> - 
        <% }
           else
           { %>
        <%= Html.ActionLink(item.Title, "Details", new { id = item.Id })%> - 
        <% } %>
        <%= Html.ActionLink("删除", "Delete", new { id = item.Id }) %>
        <hr />
    </li>        
    <% } %>
    </ul>

    <%
        if (ViewData.ContainsKey("PagerSetting"))
        {
            var urlPattern = "/Note/Index/";
            if (ViewData.ContainsKey("Tag"))
                urlPattern = string.Format("/Note/Taged/?tag={0}&num=", ViewData["Tag"]);
     %>
            <%= Html.Pager((MyNote.Helpers.PagerSetting)ViewData["PagerSetting"], urlPattern)%>
    <% } %>
</asp:Content>

